<?php
class SP_Routing_Route
{
	private $uri;
	private $uri_array;
	private $module;
	private $action;
	private $validators = array();
	

	public function setUri($value)
	{
		$this->uri=$value;
	}
	
	public function getUri()
	{
		return $this->uri;
	}
	
	public function getUriArray()
	{
		if (!$this->uri_array) $this->uri_array=SP_Common_Functions::splitSlashes($this->getUri());
		return $this->uri_array;
	}
	
	public function setValidators($validators)
	{
		if(is_array($validators))
		{
			$this->validators=$validators;
		}
	}
	
	public function setValidator($name,$validator)
	{
		$this->validators[$name]=$validator;
	}
	
	public function hasValidator($name)
	{
		return is_object($this->validators[$name]);
	}
	
	public function getValidator($name)
	{
		return $this->validators[$name];
	}
	
	public function validate($name,$value)
	{
		if (!$this->hasValidator($name)) return true;
		$this->validators[$name]->setInput($value);
		return ($this->validators[$name]->validate());
	}
	
	public function setModule($value)
	{
		$this->module=$value;
	}
	
	public function getModule()
	{
		return $this->module;
	}
	
	public function setAction($value)
	{
		$this->action=$value;
	}
	
	public function getAction()
	{
		return $this->action;
	}
	
	
	
}